package com.apartment.own.domain;

import java.io.Serializable;
import java.util.Date;

import com.apartment.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.apartment.common.annotation.Excel;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 维修订单对象 own_sys_work_order
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Data
@ApiModel("维修订单")
public class OwnSysWorkOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    @ApiModelProperty("ID")
    private String id;

    /** 删除标志（0代表存在 1代表删除） */
    @ApiModelProperty("删除标志（0代表存在 1代表删除）")
    @TableLogic
    private String delFlag;

    /** 任务状态 */
    @ApiModelProperty("任务状态")
    @Excel(name = "任务状态")
    private Integer taskStatus;

    /** 申请时间 */
    @ApiModelProperty("申请时间")
    @JsonFormat(locale="zh", timezone="GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    /** 房间表ID */
    @ApiModelProperty("房间表ID")
    @Excel(name = "房间表ID")
    private String houseResourceId;

    /** ???和哪个表做关联,报修人必须是房屋租户吗 */
    @ApiModelProperty("报修人")
    @Excel(name = "报修人")
    @NotNull(message = "请输入报修人姓名")
    private String repairUser;

    /** 报修项目 */
    @ApiModelProperty("报修项目")
    @Excel(name = "报修项目")
    @NotNull(message = "请选择报修项目")
    private String repairProjectType;

    /** 描述  */
    @ApiModelProperty("描述")
    @Excel(name = "描述")
    @NotNull(message = "请添加描述内容")
    private String userDescribed;

    /** 预计上门时间 */
    @ApiModelProperty("预计上门时间")
    @JsonFormat(locale="zh", timezone="GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预计上门时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Future(message = "请核期望上门时间")
    private Date estimatedArriveTime;

    /** 工单图片???图片是维修人员添加的还是报修人添加的 */
    @ApiModelProperty("工单图片???图片是维修人员添加的还是报修人添加的")
    @Excel(name = "工单图片???图片是维修人员添加的还是报修人添加的")
    private String workOrderImage;

    /** 紧急程度 */
    @ApiModelProperty("紧急程度")
    @Excel(name = "紧急程度")
    private Integer emergencyDegree;
    /** 紧急程度 */

    @ApiModelProperty("报修人手机号")
    @Excel(name = "报修人手机号")
    @Pattern(message = "请输入正确的手机号!", regexp = "^1[0-9]{10}$")
    private String userPhoneNumber;

    @ApiModelProperty("报修详情")
    @Excel(name = "报修详情")
    @NotNull(message = "请选择报修详情!")
    private String  reportDetails;

    @ApiModelProperty("期望上门时间")
    @Excel(name = "期望上门时间")
    @JsonFormat(locale="zh", timezone="GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "请添加期望上门时间!")
    private Date  expectedArrivalTime;

    @Override
    public String toString() {
        return "OwnSysWorkOrder{" +
                "id='" + id + '\'' +
                ", delFlag='" + delFlag + '\'' +
                ", taskStatus=" + taskStatus +
                ", applyTime=" + applyTime +
                ", houseResourceId=" + houseResourceId +
                ", repairUser='" + repairUser + '\'' +
                ", repairProjectType=" + repairProjectType +
                ", userDescribed='" + userDescribed + '\'' +
                ", estimatedArriveTime=" + estimatedArriveTime +
                ", workOrderImage='" + workOrderImage + '\'' +
                ", emergencyDegree=" + emergencyDegree +
                ", userPhoneNumber='" + userPhoneNumber + '\'' +
                ", reportDetails='" + reportDetails + '\'' +
                ", expectedArrivalTime=" + expectedArrivalTime +
                '}';
    }
}
